package com.oig.sys.base.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
import java.io.Serializable;


/**
 * @author wuxl
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "tb_enum")
@EntityListeners(AuditingEntityListener.class)
public class TbEnum implements Serializable {
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;

	/**
	 */
	@Column(name = "dict_code", nullable = false)
	private String dictCode;

	/**
	 */
	@Column(name = "dict_name", length = 128)
	private String dictName;

	/**
	 * 是否可修改 0-否 1-是
	 */
	@Column(name = "modify_flag")
	private String modifyFlag;

	@Column(name = "remark")
	private String remark;

	/**
	 * 状态 {@link com.oig.common.constants.CommonEnum.CommonStatusEnum}
	 */
	@Column(name = "status")
	private String status;

	/**
	 * 父枚举 当枚举项需要分组时，可以配一个父枚举，枚举项按父枚举的枚举值分组
	 */
	@Column(name = "parent_dict_code")
	private String parentDictCode;
	/**
	 */
	@CreatedBy
	@Column(name = "create_user_id")
	private Integer createUserId;

	/**
	 */
	@Column(name = "create_user_name", length = 32)
	private String createUserName;

	/**
	 */
	@CreatedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	private java.util.Date createTime;

	/**
	 */
	@LastModifiedBy
	@Column(name = "last_update_id")
	private Integer lastUpdateId;

	/**
	 */
	@Column(name = "last_update_name", length = 32)
	private String lastUpdateName;

	/**
	 */
	@LastModifiedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_update_time")
	private java.util.Date lastUpdateTime;

	/**
	 */
	@Version
	@Column(name = "version")
	private Integer version;

}
